package com.neouton.crm.customer.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neouton.common.util.PageUtil;
import com.neouton.crm.customer.entity.CustomerVO;
import com.neouton.crm.entity.SysUserEntity;
import com.neouton.crm.product.entity.ProductInfoVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface CustomerService {

    /**
     * 多条件分页查询客户信息列表
     * @Timestamp: 2022-11-18
     * @Author: WuJie
     * @param page 分页信息
     * @param customer 其余查询条件
     * @return 分页查询结果
     */
    PageUtil<CustomerVO> queryCustomerByPage(IPage page, CustomerVO customer,String orderBy,String token);


    /**
     * 获取客户待办列表
     * @param page
     * @param customer
     * @param orderBy
     * @param token
     * @return
     */
    PageUtil<CustomerVO> getCustomerToDoList(IPage page, CustomerVO customer,String orderBy,String token);

    /**
     * 新增或更新客户信息
     * @Timestamp: 2022-11-17
     * @Author: WuJie
     * @param customer 需更新实体
     * @return 成功失败
     */
    Boolean saveOrUpdateCustomer(CustomerVO customer,String token);

    /**
     * 禁用客户信息
     * @Timestamp: 2022-11-22
     * @Author: WuJie
     * @param customerId 需删除的ID
     * @return 成功失败
     */
    Boolean deleteCustomerById(Integer customerId);
    /**
     * 启用客户信息
     * @Timestamp: 2022-11-22
     * @Author: WuJie
     * @param customerId 需删除的ID
     * @return 成功失败
     */
    Boolean enableCustomerById(Integer customerId,Integer backUserId);

    /**
     * 更具部分条件查询客户信息是否存在
     * @Timestamp: 2022-11-18
     * @Author: WuJie
     * @param customerName 客户名称
     * @return true存在，false不存在
     */
    CustomerVO queryCustomerExit(CustomerVO customer);

    /**
     * 审批通过
     * @param customer
     * @return 成功失败
     */
    Boolean approveCustomer(CustomerVO customer,String token,Boolean auto);

    /**
     * 审批驳回
     * @param customer
     * @return
     */
    Boolean rejectionCustomer(CustomerVO customer,String token);

    /**
     * 查询并更改是否为供应商，每次刷新更新
     * @return true成功，false失败
     */
    Boolean selectIsSupplier();


    List<CustomerVO> selectCustomerByEnterpriseId(CustomerVO customer,List<SysUserEntity> userList);

    List<CustomerVO> selectAllCustomers();

    CustomerVO queryCustomerById(Integer customerId);

    List<CustomerVO> selectCustomerByCustomerName(String customerName);

    CustomerVO queryCustomerApprovalByWorkId(Integer workId);

    List<CustomerVO> selectAllEnterprise();

    void exportCustomerInfo(HttpServletResponse response, CustomerVO entit, String token) throws Exception;

    Map<String,Object> queryTodoCustomerByApprovalId(Integer approvalId);

    Map<String,Object> queryHistoryCustomerByApprovalId(Integer approvalId);

    Boolean forbiddenCustomerByApplyId(Integer approvalId);

    PageUtil<CustomerVO> getCustomerDoneList(IPage<CustomerVO> page, CustomerVO customer, String orderBy, String token);

    PageUtil<CustomerVO> getCustomerRecordsList(IPage<CustomerVO> page, CustomerVO customer, String orderBy, String token);

    CustomerVO queryCustomerCorrelationByCustomerID(int customerId,String token);

    Boolean transferCustomer(Integer userId, List<CustomerVO> customer);

    CustomerVO getCustomerDocumentaryViewInfo(Integer customerId,String token);
}
